import service from './http'

export function getUserList(data) {
  return service({
    url: 'users',
    method: 'get',
    params: {
      query: data.query,
      pagenum: data.pagenum,
      pagesize: data.pagesize
    }
  })
}

export function getState(uId, type) {
  return service({
    url: `users/${uId}/state/${type}`,
    method: 'put'
  })
}

export function addUser(data){
  return service({
    url:'users',
    method:'post',
    params:{
      username:data.username,
      password:data.password,
      email:data.email,
      mobile:data.phone
    }
  })
}